from os import listdir
from os import path as op
def search(path):
    files = listdir(path)
    for file in files:
        filepath = path + "\\" + file
        if op.isdir(filepath):
            search(filepath)
        else:
            filelist.append(filepath)
def count(filelist):
    size = sum([op.getsize(file) for file in filelist])
    length = len(filelist)
    print("文件总数：", length)
    print("文件总大小：", size)
filelist = []
root = r'C:\Users\莱恩\Desktop\A1'
search(root)
count(filelist)